package auleiy.halo.items;

import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import top.theillusivec4.curios.api.SlotContext;
import top.theillusivec4.curios.api.type.capability.ICurioItem;

public class HaloItem extends Item implements ICurioItem {

    public ResourceLocation HaloOwnerLangName;

    public HaloItem(ResourceLocation owner) {
        super(new Item.Properties());
        HaloOwnerLangName = owner;
    }

    @Override
    public void curioTick(SlotContext slotContext, ItemStack stack) {
        ICurioItem.super.curioTick(slotContext, stack);
    }

    @Override
    public Component getName(ItemStack pStack) {
        String ownerName = String.format("halo_owner.%s.%s", HaloOwnerLangName.getNamespace(), HaloOwnerLangName.getPath());
        return Component.translatable("item.ba_halos.halo", Component.translatable(ownerName));
    }

    @Override
    public int getMaxStackSize(ItemStack stack) {
        return 1;
    }
}
